<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>rem适配</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }

    /* 1. 使用媒体查询，给不同视口的屏幕设置不同的HTML字号 */
    /* @media (width:320px) {
      html{
        font-size: 32px;
      }
    }
    @media (width:375px) {
      html{
        font-size: 37.5px;
      }
    }
    @media (width:414px) {
      html{
        font-size: 41.4px;
      }
    } */
    /* 2. 使用rem单位书写尺寸 */
    .box{
      width: 3rem;
      height: 4rem;
      background-color: pink;
    }
  </style>
</head>

<body>
  <script src="./js/flexible.js"></script>
  <div class="box"></div>
</body>

</html>